<!DOCTYPE html>
<html lang="en">

<include file="CommonSidebar:common-head"/>
<link rel="stylesheet" href="__ROOT__/Application/Admin/Public/css/common.css">
<link href="__ROOT__/Application/Admin/Public/css/jquery.datetimepicker.css" rel="stylesheet">
<body>

<div id="wrapper">

    <!-- Navigation -->
    <include file="CommonSidebar:common-navbar"/>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">收书黑名单</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                            <div class="panel panel-default">
                                <div class="panel-heading" role="tab" id="headingOne">
                                    <h4 class="panel-title">
                                        <a id="TITLEALL" role="button" data-toggle="collapse" data-parent="#accordion"
                                           href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                            添加运费模板
                                        </a>
                                    </h4>
                                </div>
                                <div id="collapseOne" class="panel-collapse collapse " role="tabpanel"
                                     aria-labelledby="headingOne">
                                    <div class="panel-body">
                                        <form id="editStoreForm" action="{:U('Add')}"
                                              class="form-horizontal"
                                              method="post">
                                            <input type="hidden" id="ID" name="ID">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">运费名称:</label>

                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" id="NAME" name="NAME"
                                                           value="省内6外10，满78包邮">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">设置省内运费:</label>

                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" id="N_PRICE"
                                                           name="N_PRICE" value="6">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">设置省外运费:</label>

                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" id="W_PRICE" name="W_PRICE"
                                                           value="10">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">包邮额度:</label>

                                                <div class="col-sm-3">
                                                    <input type="text" class="form-control" id="BY_PRICE" name="BY_PRICE"
                                                           value="78">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">是否启用:</label>

                                                <div class="col-sm-3">
                                                    <select class="form-control" name="STATE">
                                                        <option value="1" style="color: #0288f3">启用</option>
                                                        <option value="0" style="color: red">关闭</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-2 ">
                                                    <button type="submit" class="btn btn-block btn-primary">保存</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                    <tr>
                                        <th style="text-align:center"><input name="all_checkbox" type='checkbox'
                                                                             id="all_checkbox"></th>
                                        <th style="text-align:center" width="12%">运费名称</th>
                                        <th style="text-align:center">设置省内运费</th>
                                        <th style="text-align:center" width="30%">设置省外运费</th>
                                        <th style="text-align:center">包邮额度</th>
                                        <th style="text-align:center">是否启用</th>
                                        <th style="text-align:center" width="10%">创建/修改时间</th>
                                        <th style="text-align:center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="DATA" item="v" key="k">
                                        <tr class="odd gradeX">
                                            <td><input name="checkbox" type='checkbox' value="{$v.ID}"></td>
                                            <td>{$v.NAME}</td>
                                            <td>{$v.N_PRICE}</td>
                                            <td>{$v.W_PRICE}</td>
                                            <td>{$v.BY_PRICE}</td>
                                            <td>{$v.STATE}</td>
                                            <td>{$v.CREATE_TIME}</td>
                                            <td><a class="btn  btn-primary" onclick="Update('{$v.ID}','{$v.NAME}','{$v.N_PRICE}','{$v.W_PRICE}','{$v.BY_PRICE}','{$v.STATE}')">编辑</a></td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>

                    </div>
                </div>


            </div>
        </div>

    </div>
</div>


<include file="CommonSidebar:common-script"/>
<script src="__ROOT__/Application/Admin/Public/js/jquery.datetimepicker.js"></script>
<!-- DataTables JavaScript -->
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="__ROOT__/Application/Admin/Public/dist/js/sb-admin-2.js"></script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->


<script type="text/javascript" src="__ROOT__/Application/Admin/Public/LoadPading/LoadPading.js?v=3"></script>
<link rel="stylesheet" href="__ROOT__/Application/Admin/Public/LoadPading/LoadPading.css" type="text/css"
      media="screen"/>


<script>
    $(document).ready(function () {
        $('#dataTables-example').DataTable({
            responsive: true
        });
    });
</script>
<script>
    $("#all_checkbox").click(function () {
        if ($(this).is(':checked')) {
            $("input[name='checkbox']").prop("checked", "true");
        } else {
            $("input[name='checkbox']").removeAttr("checked", false);

        }
    })
    //修改
    function Update(ID,NAME,N_PRICE,W_PRICE,BY_PRICE,STATE){
        $('#collapseOne').removeClass('in');
        $('#collapseOne').addClass('in');
        $('#TITLEALL').html('编辑');
        $('#ID').val(ID);
        $('#NAME').val(NAME);
        $('#N_PRICE').val(N_PRICE);
        $('#W_PRICE').val(W_PRICE);
        $('#BY_PRICE').val(BY_PRICE);
        $('#STATE').val(STATE);
    }

</script>
</body>

</html>
